
/**
 * @file log.h
 * @author fishmwei <fishmwei@qq.com>
 * @brief 
 *
 * @copyright
 * Copyright All Reserved
 *
 * This source code is licensed under BSD 3-Clause License (the "License").
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://opensource.org/licenses/BSD-3-Clause
 */

#ifndef _CLOG_TYPES_H_
#define _CLOG_TYPES_H_

#include <inttypes.h>
#include <stddef.h>


#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief Log levels used to determine if message of certain severity should be printed.
 */
typedef enum 
{
    CLOG_LL_NONE = 0,  /**< Do not print any messages. */
    CLOG_LL_ERR,       /**< Print only error messages. */
    CLOG_LL_WRN,       /**< Print error and warning messages. */
    CLOG_LL_INF,       /**< Besides errors and warnings, print some other informational messages. */
    CLOG_LL_DBG        /**< Print all messages including some development debug messages. */
} clog_log_level_t;

/**
 * @brief Sets callback that will be called when a log entry would be populated.
 *
 * @param[in] level Verbosity level of the log entry.
 * @param[in] message Message of the log entry.
 */
typedef void (*clog_log_cb)(clog_log_level_t level, const char *message);

#ifdef __cplusplus
}
#endif

#endif /* _CLOG_TYPES_H_ */
